import time

class IOPrinter:
    
    def __init__(self, readyQueue):
        self.readyQueue = readyQueue
        
        
    def getReadyQueue(self):
        return self.readyQueue
    
    def setReadyQueue(self, aQueue):
        self.readyQueue = aQueue      
                
    def executePCB(self, aPCB):
        self.execute(aPCB.getCurrentInstruction()) 
        aPCB.advance()
        
        
    def execute(self, anInst):
        print(anInst.getWord())
        time.sleep(anInst.getTime())
        
        
    def sendToReady(self, aPCB):
        self.getReadyQueue().put(aPCB)